package cn.cslg.weatherforecast.design.strategy;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.widget.Toast;

import cn.cslg.weatherforecast.LoginActivity;
import cn.cslg.weatherforecast.MainActivity;
import cn.cslg.weatherforecast.service.MusicService;
import cn.cslg.weatherforecast.util.ServiceUtils;

import static android.content.Context.MODE_PRIVATE;

public class ClickOnLogout implements Strategy {
    @Override
    public void operation(Context context) {
        SharedPreferences.Editor editor = context.getSharedPreferences("data", MODE_PRIVATE).edit();
        editor.putBoolean("isLogin", false);
        editor.commit();
        Intent intent = new Intent(context, LoginActivity.class);
        context.startActivity(intent);
    }
}
